package game;

import com.jme3.input.KeyInput;
import com.jme3.input.controls.ActionListener;
import com.jme3.input.controls.AnalogListener;
import com.jme3.input.controls.KeyTrigger;

public class ResolutionInputHandler implements ActionListener, AnalogListener {
    
    public ResolutionInputHandler() {
        DataStore.inputManager.addMapping("Pause", new KeyTrigger(KeyInput.KEY_P));
    }
    
    public void register() {
        DataStore.inputManager.addListener(this, "Pause");
    }
    
    public void onAnalog(String name, float value, float tpf) {
        
    }

    public void onAction(String name, boolean isPressed, float tpf) {
        if(isPressed) {
            if(name.equals("Pause")) {
                ResolutionController.toggleResolutionPaused();
            }
        }
    }
}
